﻿@{
    ViewBag.Title = "SignIn";
    Layout = "~/Views/Shared/_Default.cshtml";
}
@section head{
    <style type="text/css">
        body
        {
            background-color: #fff;
        }
    </style>
}
<div class="container" style="min-height:610px;padding: 50px 0;">
    <div class="page-header">
        <h1>
            用户登录 <small><i class="icon-double-angle-right"></i> 快捷，从这里起步 </small>
        </h1>
    </div>
    <div class="row-fluid">
        <div class="span10 offset1">
            <div class="widget-box">
                <div class="widget-header header-color-blue2">
                    <h4>
                        <i class="icon-user bigger-110"></i> 用户登录
                    </h4>
                </div>
                <div class="widget-body">
                @if (ViewBag.Error != null)
                {
                    <div class="alert alert-danger" style="background-color: #d15b47; color: #fff;">
                        @ViewBag.Error
                    </div>
                }
                    <form id="signinfrom" class="form-horizontal" method="post" 
                    action="/account/signin"
                    style="padding-top: 30px; margin: 0;">
                    <input type="hidden" name="ReturnUrl" value="@Request.QueryString["ReturnUrl"]" />
                    <div class="control-group">
                        <!-- Text input-->
                        <label class="control-label" for="input01">
                            <strong>用户名：</strong></label>
                        <div class="controls">
                            <input type="text" placeholder="用户名" id="txtusername" name="username"
                                class="input-xlarge {required:true,normalchar:true}" />
                        </div>
                    </div>
                    <div class="control-group">
                        <!-- Text input-->
                        <label class="control-label" for="input01">
                            <strong>密码：</strong></label>
                        <div class="controls">
                            <input type="password" placeholder="登录密码" id="txtpassword" 
                                name="password" class="input-xlarge {required:true}" />
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            &nbsp;</label>
                        <!-- Multiple Checkboxes -->
                        <div class="controls">
                            <label class="checkbox inline">
                                <input type="checkbox" name="remberme" value="true" />
                                下次记住我！
                            </label>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            &nbsp;</label>
                        <div class="controls">
                            <button type="submit" class="btn btn-primary">
                                登陆 <i class="icon-arrow-right icon-on-right bigger-110"></i>
                            </button>
                        </div>
                    </div>
                    <div class="form-actions" style="margin-bottom: 0;">
                        <a href="/account/register" class="btn btn-warning">
                            <i class="icon-group"></i>新用户注册
                        </a>
                        @*<a href="/account/forget" class="btn btn-info">
                            <i class="icon-pencil"></i>找回密码
                        </a>*@
                        <button type="button" class="btn btn-danger" id="btnreglocal" >
                            <i class="icon-magnet"></i> 注册本机
                        </button>
                    </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
@section tail{
    <script type="text/javascript" src="/scripts/jquery.validate.js"></script>
    <script type="text/javascript" src="/scripts/jquery.metadata.js"></script>
<script type="text/javascript">
    $(function () {
        $('#btnreglocal').popover({
            html:true,
            placement:'right',
            trigger:'click',
            content: '<p>我们提供一种非常便捷的使用方式，您只需点击&quot;本机注册&quot;，当您再次通过这台电脑使用网站时就和登录了一样</p><p><a href="javascript:;" onclick="LocalRegister(this)" class="btn btn-primary btn-mini">立刻使用</a></p>'
        });
        $('#signinfrom').validate({
            errorClass: "help-inline",
            errorElement: "span",
            highlight: function (element, errorClass, validClass) {
                $(element).parents('.control-group').addClass('error');
            },
            unhighlight: function (element, errorClass, validClass) {
                $(element).parents('.control-group').removeClass('error');
            }
        });
    });
</script>
}
